package com.geek.project.geekauth.handler;

import com.geek.project.geekauth.service.UserService;
import com.geek.project.geekauthapi.model.vo.LoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class LoginHandler extends Handler {

    @Autowired
    private UserService userService;

    @Override
    public void doHandler(LoginVo user) {

//        UserVo vo = userService.findUserByAccount(user);
//        if(ObjectUtil.isEmpty(vo)){
//            throw new AuthException("账号不存在");
//        }
//        if(!vo.getPasswd().equals(user.getPassword())){
//            throw new AuthException("账号或密码错误");
//        }
//        Map<String, Object> map = new HashMap<>();
//        map.put("userId", vo.getId());
//        map.put("nickname", vo.getName1());


        if(null != next) {
            next.doHandler(user);
        }
    }
}
